<?php

namespace app\controller;

use app\common\framework\HttpApiResponse;
use support\exception\BusinessException;
use support\Request;
use Webman\Http\Response;

class BaseController
{
    public static function consoleln($log)
    {
        echo date("[Y-m-d H:i:s] ");
        print_r($log);
        echo "\n";

    }

    public function __construct()
    {
        self::consoleln("this is base __construct");
    }

    public function success($data = [], $msg = "")
    {
        throw new HttpApiResponse(0, $msg, $data);
    }

    public function error($code = 999, $msg = "", $data = [])
    {
        throw new HttpApiResponse($code, $msg, $data);
    }
}
